// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
const db=cloud.database()

// 云函数入口函数
exports.main = async (event, context) => {
  const qyname= event.saveObj.qyname;
  const password = event.saveObj.password;
  const location = event.saveObj.location;
  const organ = event.saveObj.organ;
  const contact = event.saveObj.contact;
  const phone = event.saveObj.phone;
  const mail = event.saveObj.mail;
  const about = event.saveObj.about;
  const deadline = event.saveObj.deadline;
  const images = event.saveObj.images;

  return await db.collection("regest_cache").add({
    data: {
      qyname: qyname,
      password: password,
      location: location,
      organ: organ,
      contact: contact,
      phone: phone,
      mail: mail,
      about: about,
      deadline: deadline,
      images: images,
      create_time: new Date().getTime()
    }
  });
}